﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="QuanLyTaiKhoan.aspx.cs" Inherits="ThuChi.QuanLyTaiKhoan" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style9
        {}

        .style16
        {
            text-align: center;
        }
        
        .style24
        {}

        .style28
        {
        }
        
        .style30
        {
            height: 25px;
        }

    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" />
    <asp:LinqDataSource ID="LinqDataSourceTaiKhoan" runat="server" 
        ContextTypeName="ThuChi.DCThuChiDataContext" EntityTypeName="" 
        TableName="TaiKhoans" 
        Where="MaTaiKhoan != @MaTaiKhoan1 &amp;&amp; MaTaiKhoan != @MaTaiKhoan2 &amp;&amp; MaQuyen &lt;= @MaQuyen1 &amp;&amp; MaQuyen &gt;= @MaQuyen2 &amp;&amp; (TinhTrang == @TinhTrang1 || TinhTrang == @TinhTrang2)" 
        EnableUpdate="True" EnableDelete="True" 
        onselecting="LinqDataSourceTaiKhoan_Selecting">
        <WhereParameters>
            <asp:Parameter DefaultValue="1" Name="MaTaiKhoan1" Type="Int32" />
            <asp:SessionParameter DefaultValue="1" Name="MaTaiKhoan2" 
                SessionField="MaTaiKhoan" Type="Int32" />
            <asp:SessionParameter DefaultValue="3" Name="MaQuyen1" SessionField="Max" 
                Type="Byte" />
            <asp:SessionParameter DefaultValue="1" Name="MaQuyen2" SessionField="Min" 
                Type="Byte" />
            <asp:SessionParameter DefaultValue="False" Name="TinhTrang1" 
                SessionField="Max1" Type="Boolean" />
            <asp:SessionParameter DefaultValue="False" Name="TinhTrang2" 
                SessionField="Min1" Type="Boolean" />
        </WhereParameters>
    </asp:LinqDataSource>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>
    <div align="center" style="background-color: #FFFAFA">
        <img alt="" src="App_Images/loading_icon%20(2).gif" align="middle" />
    </div>
    </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <table align="center" border="1px" cellpadding="4" 
        style="border: thin solid #dbddff; width: 100%;" bgcolor="Snow">
        <tr>
            <td align="center">
                <strong>QUẢN LÝ TÀI KHOẢN</strong></td>
        </tr>
        <tr>
            <td 
                style="border: 2px solid #dbddff; font-size: 14px; " valign="middle">
                Lọc tài khoản:&nbsp;
                <asp:DropDownList ID="cboAcountFilter" runat="server" AutoPostBack="True" 
                    Width="135px" 
                    Height="20px" 
                    onselectedindexchanged="cboAcountFilter_SelectedIndexChanged" 
                    style="margin-left: 0px" Font-Size="13px">
                    <asp:ListItem Value="Tất cả">Tất cả</asp:ListItem>
                    <asp:ListItem Selected="True">Chưa kích hoạt</asp:ListItem>
                    <asp:ListItem>Đã kích hoạt</asp:ListItem>
                    <asp:ListItem>Quản trị viên</asp:ListItem>
                    <asp:ListItem>Điều hành viên</asp:ListItem>
                    <asp:ListItem>Thành viên</asp:ListItem>
                </asp:DropDownList>
            &nbsp;
                <asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red" 
                    style="margin-left: 0px"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="border: 2px solid #dbddff;">
    <asp:GridView ID="grvTaiKhoan" runat="server" AllowPaging="True" Width="100%" 
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="6" 
        CssClass="DDGridView" 
        EnableModelValidation="False" onrowdatabound="grvTaiKhoan_RowDataBound" 
        ShowFooter="True" ShowHeaderWhenEmpty="True" DataKeyNames="MaTaiKhoan" 
        DataSourceID="LinqDataSourceTaiKhoan" 
        onrowcommand="grvTaiKhoan_RowCommand" 
        onrowdeleted="grvTaiKhoan_RowDeleted" onprerender="grvTaiKhoan_PreRender">
        <Columns>
            <asp:CommandField CancelText="Hủy bỏ" DeleteText="Xóa" EditText="Sửa" 
                ShowEditButton="True" UpdateText="Cập nhật" >
            <FooterStyle Wrap="False" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
            </asp:CommandField>
<asp:BoundField DataField="TenDangNhap" HeaderText="Tên đăng nhập" 
                SortExpression="TenDangNhap" ReadOnly="True" >
            <HeaderStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="TenDayDu" HeaderText="Tên đầy đủ" 
                SortExpression="TenDayDu" >
            <HeaderStyle HorizontalAlign="Center" />
            </asp:BoundField>
             <asp:DynamicField DataField="Quyen" HeaderText="Quyền" 
                SortExpression="MaQuyen">
             <HeaderStyle HorizontalAlign="Center" />
             <ItemStyle Wrap="False" />
             </asp:DynamicField>
            <asp:CheckBoxField DataField="TinhTrang" HeaderText="Kích hoạt" 
                SortExpression="TinhTrang" >
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" />
            </asp:CheckBoxField>
            <asp:BoundField DataField="Ton" HeaderText="Tài khoản có" 
                DataFormatString="{0:N0}" SortExpression="Ton" ReadOnly="True" >
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="TongThu" DataFormatString="{0:N0}" 
                HeaderText="Tổng thu" ReadOnly="True" SortExpression="TongThu">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="TongChi" DataFormatString="{0:N0}" 
                HeaderText="Tổng chi" ReadOnly="True" SortExpression="TongChi">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="SoPhieuThu" HeaderText="Tổng số phiếu thu" 
                 ReadOnly="True" SortExpression="SoPhieuThu" >
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="SoPhieuChi" HeaderText="Tổng số phiếu chi" 
                 ReadOnly="True" SortExpression="SoPhieuThu" >
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="NgayTao" HeaderText="Ngày tạo" 
                 DataFormatString="{0:dd-MM-yyyy h:mm tt}" ReadOnly="True" 
                SortExpression="NgayTao" >
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Left" Wrap="False" />
            </asp:BoundField>
        </Columns>
        <FooterStyle CssClass="DDFooter" Wrap="True" />
        <HeaderStyle HorizontalAlign="Center" CssClass="th" />
        <PagerSettings FirstPageImageUrl="~/DynamicData/Content/Images/PgFirst.gif" 
            FirstPageText="" LastPageImageUrl="~/DynamicData/Content/Images/PgLast.gif" 
            LastPageText="" Mode="NumericFirstLast" NextPageText="" PageButtonCount="8" 
            PreviousPageText="" />
        <PagerStyle CssClass="DDPager" />
        <RowStyle CssClass="td" Wrap="True" />
    </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style="border: 2px solid #dbddff; font-size: 14px; ">
                    Phân trang: 
                    <asp:DropDownList ID="cboPageSize" runat="server" AutoPostBack="True" 
                        Width="45px" 
                        Height="20px" 
                        style="margin-right: 0px; margin-left: 0px;" 
                        onselectedindexchanged="cboPageSize_SelectedIndexChanged" Font-Size="13px">
                        <asp:ListItem Value="1">1</asp:ListItem>
                        <asp:ListItem Selected="True">5</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>20</asp:ListItem>
                        <asp:ListItem>30</asp:ListItem>
                        <asp:ListItem>50</asp:ListItem>
                    </asp:DropDownList>
            </td>
        </tr>
    </table>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
